package zky.medicalInstitute.BlueTooth;

import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothManager;
import android.content.Context;
import android.os.Build;
import android.widget.Toast;

public class BlutTooth {
    private BluetoothManager bluetoothmanger;
    private BluetoothAdapter bluetoothadapter;
//    /**
//     * 判断蓝牙是否支持
//     */
//    public void checkBluthTooth() {
//
//        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
//            bluetoothmanger = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);
//        }
//        bluetoothadapter = bluetoothmanger.getAdapter();
//        if (bluetoothadapter == null) {
//            Toast.makeText(MainActivity.this, "设备不支持蓝牙", Toast.LENGTH_SHORT).show();
//        } else {
//            Toast.makeText(MainActivity.this, "设备支持蓝牙====", Toast.LENGTH_SHORT).show();
//        }
//    }

    /**
     * 判断蓝牙是否开启
     *
     * @return
     */
    public boolean blueisenable() {
        if (bluetoothadapter.isEnabled()) {
            return true;
        } else {
            return false;
        }
    }
    /**
     * 搜索蓝牙
     */
    /**
     * 连接蓝牙
     */
    /**
     * 传输数据
     */
}
